<template>
  <div :class="mode">
    <button @click="btnClick">切换主题色</button>
  </div>
</template>

<script setup>
import { useColorMode } from '@vueuse/core'
const mode = useColorMode()
const btnClick = () => {
  mode.value = mode.value === 'light' ? 'dark' : 'light'
}
</script>

<style lang="scss" scoped></style>
